/*
 * GPUC
 * 
 * Copyright © 2008 Attila T. Áfra <attila.afra@gmail.com>
 * 
 * This program is free software: you can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program. If
 * not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _GPUC_COMMON_PRIVATE_H
#define _GPUC_COMMON_PRIVATE_H

#include <GL/glew.h>

#if defined(_WIN32)
#include <windows.h>
#else
#include <GL/glx.h>
#endif

#include <GPUC/Common.h>

/*------------------------------------------------------------------------------------------------*/

extern GPUC_Bool GPUC_contextInitialized;

#if defined(_WIN32)

#ifdef UNICODE
extern const wchar_t *GPUC_wglWindowClassName;
#else
extern const char    *GPUC_wglWindowClassName;
#endif

extern HINSTANCE GPUC_wglModuleHandle;
extern WNDCLASS  GPUC_wglWindowClass;
extern HWND      GPUC_wglWindowHandle;
extern HDC       GPUC_wglDeviceContext;
extern HGLRC     GPUC_wglRenderingContext;

#else

extern Display    *GPUC_glxDisplay;
extern GLXPbuffer  GPUC_glxPbuffer;
extern GLXContext  GPUC_glxContext;

#endif

extern GPUC_Bool   GPUC_initialized;
extern GPUC_Error  GPUC_error;
extern int         GPUC_objectCount;
extern GLuint      GPUC_framebufferId;
extern GLenum     *GPUC_drawBuffers;
extern GLuint      GPUC_vertexShaderId;
extern int         GPUC_maxTextureRectSize;
extern int         GPUC_maxTextureImageUnitCount;
extern int         GPUC_maxDrawBufferCount;

/*------------------------------------------------------------------------------------------------*/

void
GPUC_ignoreGlErrors();

GPUC_Bool
GPUC_isGlError();

int
GPUC_checkGlError(GLenum error);

/*------------------------------------------------------------------------------------------------*/

#endif // _GPUC_COMMON_PRIVATE_H
